<ion-view view-title="易信">
  <ion-nav-buttons side="right">
    <button ng-click="openNewChat()" class="button button-clear button-icon ion-android-add"></button>
    <button class="button button-icon ion-navicon rotate90" menu-toggle="right"></button>
  </ion-nav-buttons>

  <ion-content>
    <ion-list>
      <ion-item class="item-chat item-avatar margin-bottom-large" type="item-text-wrap" ui-sref="app.im.notice">
        <i class="item-image icon assertive ion-ios-bell-outline"></i>
        <!-- <img ng-src="{{notice | chatPicture}}"> -->
        <h2 class="assertive">公司通知<span class="item-note font-small">{{notice[0].last_message.timestamp | amTimeAgo}}</span></h2>
        <p>{{notice[0].last_message.user.name}}: {{notice[0].last_message.content | delHtmlTag:'html' | limitTo:50}}</p>
      </ion-item>

      <ion-item
        ng-repeat="chat in chats | orderBy:'-last_message.timestamp'"
        class="item-chat item-remove-animate item-avatar"
        type="item-text-wrap"
        ui-sref="app.im.chat-detail({'_id': chat._id})">
        <img ng-src="{{chat | chatPicture}}">
        <h2>{{chat | chatName}}<span class="item-note font-small">{{chat.last_message.timestamp | amTimeAgo}}</span></h2>
        <p>{{chat.last_message.content | delHtmlTag:'html' | limitTo:50}}</p>

        <ion-option-button class="button-assertive" ng-click="remove(chat)">
          删除
        </ion-option-button>
      </ion-item>
    </ion-list>
    <p class="padding-top text-center dark2">操作 : 左滑列表项可更改或删除 </p>

  </ion-content>
</ion-view>
